package com.jvm.shk;

/**
 * @author ：qs
 * @date ：Created in 2022/7/10
 * @description：
 * @modified By：
 */
public class StringExer {
    String str = new String("good");
    char[] ch = {'t', 'e', 's', 't'};

    public void change(String str, char ch[]) {
//        str = "test ok";
        str = str.replace("d", "a");
        ch[0] = 'b';
//        char[] cha = {'t', '3', '8', 't'};
//        ch = cha;
//        System.out.println("chaaaa  " + ch[1]);
    }

    public static void main(String[] args) {
//        String a = "aaa";
//        String b = new String("aaa").intern();
//        System.out.println(a==b);
//
//        StringExer ex = new StringExer();
//        ex.change(ex.str, ex.ch);
//        System.out.println(ex.str);// good
//        System.out.println(ex.ch);



        System.out.println();//2293
        System.out.println("1");//2294
        System.out.println("2");
        System.out.println("3");
        System.out.println("4");
        System.out.println("5");
        System.out.println("6");
        System.out.println("7");
        System.out.println("8");
        System.out.println("9");
        System.out.println("10");//2303
        //如下的字符串"1" 到 "10"不会再次加载
        System.out.println("1");//2304
        System.out.println("2");//2304
        System.out.println("3");
        System.out.println("4");
        System.out.println("5");
        System.out.println("6");
        System.out.println("7");
        System.out.println("8");
        System.out.println("9");
        System.out.println("10");//2304
    }
}
